#ifndef STATE_HPP
#define STATE_HPP

#include "dislib.h"

#include "conversion.h"
#include "bit.h"

#include <iostream>
#include <fstream>
#include <time.h>
#include <complex>

#define SIZE_BLOCK 1024*1024

typedef std::complex<double> complexd;

typedef struct elem_ind {
    complexd data;
    long long ind;
}e_i;

using namespace std;

    void Recieve(int, void*, int);
    complexd* temppp;
static long pointer = 0;;

class State {
    int common_dimension, dimension;
    long long common_length, length;
    long long begin, end, size_block;
    int rank, size;
    complexd* vec;

    complexd vector(long long, complexd*, int);
    int what_is_index(long long);
    int power_2(long long);
    void define_size();
public:
    int what_is_rank(long long);

    State(int);
    State(const State &);
    ~State();

    void randomFill();
    void intentionalFill(long long, complexd * );

    void doConversion(Conversion &, int);
    void nConversion(Conversion &);
    void n0Conversion(Conversion &);
    void norma();

    int getRank();
    int getSize();
    long long getLong();
    int getDimension();

    void output(char *);
    void input(char *);

    long long getMyLong();
    complexd* getMyVector();
    int getMyDimension();

    void info();
    void output();
    State operator=(State);
    bool operator==(State);
    bool operator!=(State);

    void Sendrecv(complexd *, int);

    friend ostream& operator<<(ostream &, State &);
    friend istream &operator>>(istream &, State &);
};


#endif // STATE_HPP
